<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <base href="/ExamMVC/">
    <meta charset="UTF-8">
    <title>在线考试系统</title>
    <script src="js/vue.min.js"></script>
    <script src="js/jquery.min.js"></script>
    <script src="js/axios.min.js"></script>

    <style>
        *{padding: 0px;margin: 0px}
        body{
            background: url('img/背景01.jpg') no-repeat fixed center;
            width: 100%;
            min-width: 500px;
            min-height: 500px;
        }
        #main{
            width: 400px;
            height: 350px;
            background: rgba(255, 255, 255, 0.97);
            position: fixed;
            left: 50%;
            top: 50%;
            transform: translate(-50%,-50%);
        }
        .loginBox{
            text-align: center;
            padding-top: 10px;
        }
        .loginBox hr{
            margin-top: 10px;
            margin-bottom: 50px;
        }
        .loginBox div {
            text-align: center;
            margin-top: 20px;
        }
        .loginBox input {
            font-size: 20px;
            border: 1px solid #000000;
            border-radius: 3px;
            padding: 4px 10px;
        }
        .loginBox button {
            font-size: 20px;
            border: 0;
            border-radius: 20px;
            background-color: rgba(224, 222, 23, 0.71);
            line-height: 35px;
            width: 100px;
            height: 40px;
        }
        .loginBox button:hover{
            background-color: #ffff00;
            cursor: pointer;
        }
        .loginBox button a{
            text-decoration: none;
            color: white;
        }
        .loginBox button a:hover{
            color: black;
        }
    </style>
</head>
<body>
    <div id="main">
        <div class="loginBox">
            <h1>在线考试系统</h1>
            <hr>
            <div id="jump">
                <div><input type="text" v-model="account" placeholder="输入账号"/></div>
                <div><input type="text" v-model="password" placeholder="输入密码"/></div>
                <div>
                    <button @click="flush"><a v-bind:href="href">{{msg1}}</a></button>
                </div>
            </div>
            <hr>
            <h4>忘记密码?请联系管理员</h4>
        </div>
    </div>

    <script>
        let vm = new Vue({
            el:"#jump",
            data:{
                msg1:"登录",
                href:"javascript:void(0)",
                account: "",
                password:"",
            },
            methods:{
                flush:function (){
                    axios.get("userLogin",{
                        params:{
                            account:this.account,
                            password: this.password,
                        }
                    }).then(result=>{
                        location.href = result.data;
                    })
                }
            },
            //页面加载完执行
            mounted:function (){

            }
        })
    </script>
</body>
</html>